<%@ page contentType="text/html;charset=ISO8859_1" language="java" 
 import="java.util.*" %>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-nested.tld" prefix="nested" %>

<jsp:useBean id="oLogon" class="git.bankview.wl.bean.LogonBean" scope="session" />
<jsp:useBean id="journals" type="java.util.Map" scope="application" />
<%
	git.bankview.wl.auth.UserAuth.validate(oLogon, "90070", 1);
	session.setAttribute("auth.90070.1", Boolean.TRUE);
%>
<jsp:useBean id="oNavigate" class="git.bankview.wl.bean.TransNavigateBean" />
<jsp:setProperty name="oNavigate" property="transid" value="90070" />

<html:html locale="true">
<head>
	<meta http-equiv=content-type content="text/html; charset=GBK">
	<title><logic:iterate id="element" name="oNavigate" property="navigateList"
	><bean:write name="element" property="translabel" />
	 - </logic:iterate><bean:message key="journalmonitor.title" /></title>
	<link rel="stylesheet" href="../../style/default_aux.css" id="oCssLink">
	<script language="javascript" src="../../script/pagetuner.js"></script>
</head>
<body onload="oninit()">
	<script src="../../script/overlib.js" language="JavaScript"></script>
	<script src="../../script/style.js" language="JavaScript"></script>
	<script src="../../script/windows.js" language="JavaScript"></script>
	<script src="../../script/lajax.js" language="JavaScript"></script>
	
	<table cellspacing="0" class="filledframe">
		<tr>
			<td nowrap="" class="clientframe">
				<table id="oHelp" class="helper" >
					<tr><td>&nbsp;</td><td class="help"><input type="button" class="button" title="<bean:message key="common.help.title" />" onclick="help('help.report.schd');" value="<bean:message key="common.help" />" ></td>
					</tr>
				</table>
				<div class="listtitle"><logic:iterate id="element" name="oNavigate" property="navigateList"
					><logic:empty name="element" property="pageurl"><bean:write name="element" property="translabel" /></logic:empty
					><logic:notEmpty name="element" property="pageurl"><a href="<bean:write name="element" property="pageurl" />" title="<bean:write name="element" property="transid" />"><bean:write name="element" property="translabel" /></a></logic:notEmpty
					><img src="../../images/navconn.gif" ></logic:iterate><bean:message key="journalmonitor.title" 
					/></div>

				<table class="tabheader" width="90%" >
					<tr id="oToolBar">
						<td align="left" width="5%" nowrap=""><bean:message key="journalmonitor.type" /></td>
						<td align="left" width="5%" nowrap=""><select id="oJournalName" onchange="clearJournal()">
						<%
	for (Iterator it = journals.keySet().iterator(); it.hasNext(); )
	{
		String journalKey = (String)it.next();
						%><option value="<%=journalKey%>"><bean:message key="<%=journalKey%>" /></option><%
	}
						%>
						</select></td>
						<td align="left" width="5%" nowrap=""><bean:message key="common.autoRefresh" /></td>
						<td align="left" width="5%" nowrap=""><input type="checkbox" name="oAutoRefresh" onclick="if (this.checked) reloadJournal();" ></td>
						<td align="left" nowrap="">&nbsp;</td>
					</tr>
				</table>
				
				<table class="formpanel" width="90%" height="75%">
					<tr><td class="description"><div id="oJournalText" class="journal" style="width: 100%; height: 100%"></div></td></tr>
				</table>
			</td>
			<!-- td id="oFrame" nowrap="" class="infoframe" rowspan="2">&nbsp;</td -->
		</tr>
		<tr>
			<td class="clientfooter"><bean:message key="journalmonitor.tips" /></td>
		</tr>
	</table>

<script language="javascript">
<!--

var request = null;
var oKeyWordRe = null;

function onCorrectResponse(doc)
{
	//alert(doc.xml);
	
	var v = doc.getElementsByTagName("journal");
	if (0 < v.length)
	{
		var i;
		for (i = 0; i < v.length; ++i)
			appendJournal(v[i].text);
	
		oJournalText.doScroll("scrollbarPageDown");
		
		if (oAutoRefresh.checked)
			reloadJournal();
	}
	else
	{
		if (oAutoRefresh.checked)
			setTimeout("reloadJournal()", 3000);
	}
}
function appendJournal(jtext)
{
	var line = document.createElement("<div nowrap >");
	line.innerText = jtext;
	var newHtml = line.innerHTML.replace(oKeyWordRe, "<b>$1</b>");
	
	if (line.innerHTML.length != newHtml.length)
	{
		line.innerHTML = newHtml;
		line.className = "highlight";
	}
		
	oJournalText.appendChild(line);
	
	if (500 < oJournalText.childNodes.length)
	{
		oJournalText.removeChild(oJournalText.childNodes[0]);
	}
}
function oninit()
{
	initKeyWordRe();
	request = new Request();
	request.onCorrectResponse = onCorrectResponse;
	reloadJournal();
}
function initKeyWordRe()
{
	var v = new Array("err", "warn", "fault", "invalid", "fail", "unsuccessful"
		, "fatal", "wrong", "unexpected", "exception", "cannot"
		, "miss", "mistake", "illegal", "incorrect", "alert");
	
	var regstr = '';
	var i;
	for (i = 0; i < v.length; ++i)
	{
		if (0 < i)
			regstr += "|";
			
		regstr += ("[A-Z|a-z]*" + v[i] + "[A-Z|a-z]*");
	}
	
	oKeyWordRe = new RegExp("(" + regstr + ")", "gi");
}
function reloadJournal()
{
	request.send("JournalMonitor_getter.jsp?journal=" + oJournalName.value);
}
function clearJournal()
{
	oJournalText.innerHTML = '';
}
-->
</script>
<script for="window" event="onbeforeprint">document.all.oCssLink.href = "../../style/default_auxp.css";</script>
<script for="window" event="onafterprint">document.all.oCssLink.href = "../../style/default_aux.css";</script>
</body>
</html:html>










